/*
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package factory;

import java.sql.Connection;
import java.sql.DriverManager;

public final class FbSQLConnectionFactory extends ConnectionDb{

    public FbSQLConnectionFactory() {
        this.open();
    }

    @Override
    public Connection open() {
        String className = "org.firebirdsql.jdbc.FBDriver";
        String url;
        String loginDb = "SYSDBA";
        String passwordDb = "masterkey";
        String strOS = System.getProperty("os.name").toLowerCase();
        if (strOS.startsWith("windows")) {
            url = "jdbc:firebirdsql://localhost:3050/IndiaDB_New";
        } else {
            url = "jdbc:firebirdsql://192.168.1.1:3050/IndiaDB_New";
        }
        try {
            Class.forName(className);
            this.connection = DriverManager.getConnection(url,loginDb,passwordDb);
                    
        } catch (Exception e) {
            e.printStackTrace();
        }
        return this.connection;
    }
}